const express = require("express")
const cors = require("cors")
const mongoose = require("mongoose")
const Schema = mongoose.Schema
mongoose.connect("mongodb://127.0.0.1:27017/hahahadang_test")
const app = express()


const UserType = {
    name:String,
    address: String,
    tel:String
}
const UserModel = mongoose.model("user",new Schema(UserType))
// 允许所有人访问
app.use(cors()) 

app.get("/", (req, res) => {
    // res.send('<h1>123456</h1>')   //相当于write 和end 并且不需要头部 
    res.send({      //并且传输的数据也不需要一定整json  非常的人性
    
    })
})
app.listen(3000, () => {
    console.log("server start");
})